package com.hc.dfs.activity;

import java.util.ArrayList;
import java.util.HashMap;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ListView;
import android.widget.SimpleAdapter;
import android.widget.AdapterView.OnItemClickListener;

public class ContactActivity extends BaseActivity{
	
	private ListView list;
	private ArrayList<HashMap<String, Object>> dataList;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.contact);
		list = (ListView) findViewById(R.id.list);
		dataList = new ArrayList<HashMap<String, Object>>();
		for(int i=0; i<10; i++){
			HashMap<String, Object> map = new HashMap<String, Object>();
			map.put("icon", R.drawable.arrow);
			map.put("deptName", "大通置业"+i);
			dataList.add(map);
		}
		SimpleAdapter sa = new SimpleAdapter(this,dataList, R.layout.contact_dept_item, new String[]{"icon","deptName"}, new int[]{R.id.imageView1, R.id.textView1});
		list.setAdapter(sa);
		list.setOnItemClickListener(new OnItemClickListener() {

			@Override
			public void onItemClick(AdapterView<?> parent, View view,
					int position, long id) {
				// 处理点击列表条目事件
				//添加根据id查询成员的任务
				//切换到部门成员页
				startActivity(new Intent(ContactActivity.this, ContactMemberActivity.class));
			}
		});
	}

	@Override
	public void onClick(View v) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void init() {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void refresh(Object... param) {
		// TODO Auto-generated method stub
		
	}

}
